//::TODO
<template>
  <i
    :class="[
      'Ionicons',
      `el-${iconname}`
    ]"
    :style="styles"
  />
</template>

<script lang="ts" setup>
/* eslint-disable no-unused-vars */
import { computed } from 'vue'
const props = defineProps({
  name: {
    type: String,
    required: true
  },
  color: {
    type: String,
    default: '#5c6b77'
  },
  size: {
    type: Number,
    default: 16
  }
})
const iconname = computed(() => {
  return toUpCase(props.name.split('-')[1])
  // return (props.name.split('-')[1])
})
// 首字母大写
const toUpCase = (key:string) => {
  const arr = key.split('')
  arr.splice(0, 1, key.split('')[0].toUpperCase())
  key = arr.join('')
  return key
}
// const styles = computed(() => {
//   return {
//     fontSize: `${props.size}px`,
//     color: props.color
//   }
// })
</script>

<style lang="scss">

</style>
